package com.project.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.time.LocalDate;
import java.util.List;
@TableName("t_order")
public class OrderBean {
    /**
     * 订单ID
     */
    @TableId(value = "pk_orderId",type = IdType.AUTO)
    private Integer id;
    /**
     * 用户名
     */
    @TableField("o_name")
    private String name;

    /**
     * 收货地址
     */
    @TableField("o_address")
    private String address;

    /**
     * 收件人电话
     */
    @TableField("o_phone")
    private String phone;

    /**
     * 发货日期
     */
    @TableField("o_date")
    private LocalDate date = LocalDate.now();

    /**
     * 价格
     */
    @TableField("o_money")
    private Integer money;
    /**
     * 用户ID
     */

    @TableField("fk_userId")
    private Integer userId;

    /**
     * 状态
     */
    @TableField("o_status")
    private String status="未发货";

    /**
     * 订单详情
     */
    @TableField(exist = false)
    private List<InfoBean> infoBeans;

    public OrderBean() {
    }

    public OrderBean(String name, String address, String phone,Integer userId) {
        this.name = name;
        this.address = address;
        this.phone = phone;
        this.userId = userId;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public LocalDate getDate() {
        return date;
    }

    public void setDate(LocalDate date) {
        this.date = date;
    }

    public Integer getMoney() {
        return money;
    }

    public void setMoney(Integer money) {
        this.money = money;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public List<InfoBean> getInfoBeans() {
        return infoBeans;
    }

    public void setInfoBeans(List<InfoBean> infoBeans) {
        this.infoBeans = infoBeans;
    }

    @Override
    public String toString() {
        return "Order{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", address='" + address + '\'' +
                ", phone='" + phone + '\'' +
                ", date=" + date +
                ", money=" + money +
                ", userId=" + userId +
                ", status='" + status + '\'' +
                ", infoBeans=" + infoBeans +
                "}\n";
    }
}
